import request from "./request";
// 新增购物车
export function insertCart(obj){
    return request.post('/user/shopCart/add',obj)
}
// 查询购物车
export function getCart(){
    return request.get('/user/shopCart/list')
}
// 减少购物车
export function subCartNum(obj){
    return request.post('/user/shopCart/sub',obj)
}
// 删除单个商品
export function delOne(id){
    return request.delete(`/user/shopCart/${id}`)
}
// 清空购物车
export function clearCart(){
    return request.delete('/user/shopCart/clear')
}
//选中单个
export function checkOne(id){
    return request.put(`/user/shopCart/check/${id}`)
}
//取消勾选单个
export function unCheckOne(id){
    return request.put(`/user/shopCart/unCheck/${id}`)
}
//全部勾选
export function checkAll(){
    return request.put('/user/shopCart/checkAll')
}
//全部取消勾选
export function unCheckAll(){
    return request.put('/user/shopCart/unCheckAll')
}

// 购物车下单
export function submitCart(addressBookId){
    return request.post(`/user/shopCart/submit/${addressBookId}`)
}

